import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class TextFieldFormPage extends StatelessWidget{
  TextEditingController _editingController=TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('TextFieldFormPage'),
      ),
      body:Padding(
        padding: EdgeInsets.all(30),
        child: Column(
          children: <Widget>[
            TextField(
              decoration: InputDecoration(
                  prefixIcon: Icon(Icons.supervised_user_circle),
                  labelText:'用户名：',
                  hintText: '输入用户名'
              ),
              onChanged: (value){
                print(value);
              },
              controller:_editingController ,
            ) ,
            TextField(
              decoration: InputDecoration(
                  prefixIcon: Icon(Icons.lock),
                  labelText:'密码：',
                  hintText: '输入密码'
              ),
              obscureText: true,
              keyboardType: TextInputType.numberWithOptions(),
            ),
            Container(
              child: TextField(
                decoration: InputDecoration(
                    prefixIcon: Icon(Icons.lock), 
                    labelText:'密码：',
                    hintText: '输入密码',
                  focusedBorder:InputBorder.none
              ),
                obscureText: true, 
                keyboardType: TextInputType.numberWithOptions(),
              ),
              decoration: BoxDecoration(
                border: Border.all(color: Colors.red)
              ),
            ),
            RaisedButton(
              child: Text('登录'),
              onPressed: (){
                print("login "+_editingController.text);
              },
              color: Colors.lightBlue,
            )
          ],
        ),
      )
    );
  }
}